Skip to content

Read SAML parameters from their binding in the .NET Fedlet; run e2e scripts without a shell - #1139

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fedlet-sample-hardening
Sep 29, 2026
Merged

vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fedlet-sample-hardening

Conversation

@vharseko

Copy link
Copy Markdown
Member

The .NET Fedlet and e2e cluster of the CodeQL medium triage: cs/web/ambiguous-client-variable ×12, cs/web/directory-browse-enabled ×1, js/indirect-command-line-injection ×1.

The change

  • ServiceProviderUtility.cs read SAMLRequest, SAMLResponse and SAMLart through HttpRequest's indexer (request[name]), which searches QueryString, Form, Cookies and ServerVariables in that order — so a cookie named SAMLResponse could stand in for a posted one. A SAML binding carries the message only in the form of a POST or the query string of a GET; the new GetBindingParameter(request, name) reads it from there and nowhere else, and all 12 reads go through it. GetLogoutRequest already branched on HttpMethod; ProcessSamlResponse and GetLogoutResponse now do so through the helper.
  • SampleApp/Web.config: directoryBrowse off. The sample is what people deploy first.
  • e2e/saml/saml-test.spec.mjs: execSync(\bash "${scriptPath}"`)→execFileSync("bash", [scriptPath])` — the path is an argument, not a shell command line.

Left as it is, proposed for dismissal

  • IdentityProviderDiscoveryUtils.cs:171 (cs/web/unvalidated-url-redirection): the redirect target is the circle-of-trust reader-service URL from the Fedlet configuration; only the RelayState query value comes from the request, and that is the request's own URL.

Verification

The Fedlet library compiles with csc against the mono 4.5 framework assemblies (0 errors); node --check on the spec. No Java module is touched.

…cripts without a shell

The Fedlet service-provider utility read SAMLRequest, SAMLResponse and
SAMLart through HttpRequest's indexer, which also searches cookies and
server variables; a SAML binding carries them only in the form of a POST
or the query string of a GET, and GetBindingParameter reads them from
there. The sample application no longer enables directory browsing, and
the SAML e2e spec passes the setup script path to bash as an argument
instead of interpolating it into a shell command line.
@vharseko vharseko added security Security fix or hardening (CVE, GHSA, XSS/CSRF/SSRF) saml SAML / SAML2 federation dotnet Changes to the .NET Fedlet (C# service-provider library and sample) javascript Pull requests that update Javascript code tests Test suite: coverage, fixtures, or test infrastructure labels Sep 18, 2026

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The fix sits at the single point where the Fedlet reads SAML binding parameters.

  • GetBindingParameter (ServiceProviderUtility.cs:1691) is now the only read path: all 12 former request[...] reads in GetAuthnResponse, GetLogoutRequest and GetLogoutResponse go through it, and no indexer read is left under csharpsource.
  • The e2e change was exercised: build-docker at this head ran saml/saml-test.spec.mjs, whose beforeAll calls execScript, and it passed.

@vharseko
vharseko merged commit 62e51ae into OpenIdentityPlatform:master Sep 29, 2026
15 checks passed
@vharseko
vharseko deleted the fedlet-sample-hardening branch September 29, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnet Changes to the .NET Fedlet (C# service-provider library and sample) javascript Pull requests that update Javascript code saml SAML / SAML2 federation security Security fix or hardening (CVE, GHSA, XSS/CSRF/SSRF) tests Test suite: coverage, fixtures, or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants